<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('招聘列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>真实姓名：</label>
                                <input type="text" name="realName"/>
                            </li>
                            <li>
                                <label>应聘岗位：</label>
                                <select name="recruit" th:with="type=${@dict.getType('wretchant_recruit')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>性别：</label>
                                <select name="sex" th:with="type=${@dict.getType('wretchant_sex')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>到岗时间：</label>
                                <select name="arrivalTime" th:with="type=${@dict.getType('wretchant_arrival_time')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>离职状态：</label>
                                <select name="resignationStatus" th:with="type=${@dict.getType('wretchant_resignation_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>通勤时间：</label>
                                <select name="commutingTime" th:with="type=${@dict.getType('wretchant_commuting_time')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>教育程度：</label>
                                <select name="education" th:with="type=${@dict.getType('wretchant_education')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>背景调查：</label>
                                <select name="backgroundInvestigation" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>薪资调查：</label>
                                <select name="salarySurvey" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>是否接受出差：</label>
                                <select name="businessTravel" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>面试情况：</label>
                                <select name="interviewSituation" th:with="type=${@dict.getType('wretchant_interview_situation')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>离职原因：</label>
                                <input type="text" name="reasonsForResignation"/>
                            </li>
                            <li>
                                <label>学信网学历编号：</label>
                                <input type="text" name="studyNumber"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="wretchant:recruit:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="wretchant:recruit:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="wretchant:recruit:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="wretchant:recruit:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('wretchant:recruit:edit')}]];
        var removeFlag = [[${@permission.hasPermi('wretchant:recruit:remove')}]];
        var recruitDatas = [[${@dict.getType('wretchant_recruit')}]];
        var sexDatas = [[${@dict.getType('wretchant_sex')}]];
        var arrivalTimeDatas = [[${@dict.getType('wretchant_arrival_time')}]];
        var resignationStatusDatas = [[${@dict.getType('wretchant_resignation_status')}]];
        var commutingTimeDatas = [[${@dict.getType('wretchant_commuting_time')}]];
        var educationDatas = [[${@dict.getType('wretchant_education')}]];
        var backgroundInvestigationDatas = [[${@dict.getType('sys_yes_no')}]];
        var salarySurveyDatas = [[${@dict.getType('sys_yes_no')}]];
        var businessTravelDatas = [[${@dict.getType('sys_yes_no')}]];
        var interviewSituationDatas = [[${@dict.getType('wretchant_interview_situation')}]];
        var prefix = ctx + "wretchant/recruit";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "招聘",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'gmtCreate',
                    title: '创建时间'
                },
                {
                    field: 'realName',
                    title: '真实姓名'
                },
                {
                    field: 'recruit',
                    title: '应聘岗位',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(recruitDatas, value);
                    }
                },
                {
                    field: 'sex',
                    title: '性别',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(sexDatas, value);
                    }
                },
                {
                    field: 'arrivalTime',
                    title: '到岗时间',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(arrivalTimeDatas, value);
                    }
                },
                {
                    field: 'resignationStatus',
                    title: '离职状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(resignationStatusDatas, value);
                    }
                },
                {
                    field: 'commutingTime',
                    title: '通勤时间',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(commutingTimeDatas, value);
                    }
                },
                {
                    field: 'education',
                    title: '教育程度',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(educationDatas, value);
                    }
                },
                {
                    field: 'backgroundInvestigation',
                    title: '背景调查',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(backgroundInvestigationDatas, value);
                    }
                },
                {
                    field: 'salarySurvey',
                    title: '薪资调查',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(salarySurveyDatas, value);
                    }
                },
                {
                    field: 'businessTravel',
                    title: '是否接受出差',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(businessTravelDatas, value);
                    }
                },
                {
                    field: 'interviewSituation',
                    title: '面试情况',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(interviewSituationDatas, value);
                    }
                },
                {
                    field: 'currentSalary',
                    title: '目前薪资'
                },
                {
                    field: 'salaryExpectation',
                    title: '期望薪资'
                },
                {
                    field: 'resumeAddress',
                    title: '简历地址',
                    formatter: function(value, row, index) {
                        if (row.resumeAddress){
                            return '<a href="' + row.resumeAddress + '">点击预览</a>';
                        }
                    }
                },
                {
                    field: 'studyNumberFile',
                    title: '学信网学历截图',
                    formatter: function(value, row, index) {
                        if (row.studyNumberFile){
                            return '<a href="' + row.studyNumberFile + '">点击预览</a>';
                        }
                    }
                },
                {
                    field: 'salaryFile',
                    title: '薪资流水截图',
                    formatter: function(value, row, index) {
                        if (row.salaryFile){
                            return '<a href="' + row.salaryFile + '">点击预览</a>';
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>